#include <iostream>
#include <bitset> 
using namespace std;
 
 
int main()
{
	unsigned char num;
	cin>>num;
	bitset<8> bb(num);
	cout<<bb.count()<<endl;
	cout<<bb<<endl; 
	return 0;
}
